<?php
/**
 * Abstract service to manage Feeds
 */
interface Model_FeedService 
{
	/**
	 * Retrieve e list of top ten feed in the given category
	 * 
	 * @param int $catID
	 * @return array of Model_Entity_Feed
	 */
	public function getTopTenFeeds($catID);
	
	/**
     * Get all user feed that needs to be upgraded
     * 
     * @param int $userID
     * @param int $interval update interval in seconds
     * @return array of Model_Entity_Feed
     */
    public function getFeedToUpgrade($userID, $interval);
    
    /**
     * Get all boxes' feeds that needs to be upgraded
     * 
     * @param int $interval update interval in seconds
     * @return array of Model_Entity_Feed
     */
    public function getFeedBoxToUpgrade($interval);
    
	/**
     * Get all user feed beginning to a given category
     * 
     * @param int $userID
     * @param int $catID optional
     * @return array of Model_Entity_Feed
     */
    public function getUserFeed($userID, $catID = null);
    
    /**
     * Get all feed from user's preferred category
     * 
     * @param int $catID
     * @param int $userID
     * @return array of Model_Entity_Feed
     */
    public function getSuggestedFeed($catID, $userID);
    
	/**
     * Search for feed matching search criteria based on category and
     * contents of name,url and description fields
     * If no criteria are specified it will return the entire list of feeds
     * in the system
     * 
     * @param array $criteria an optional associative array 
     * @return Zend_Paginator_Adapter_Interface
     */
    public function searchFeeds($criteria = null);

    /**
     * Update last sync timestamp on a given feed
     * 
     * @param int $feedID
     * @return void
     */
    public function updateLastSync($feedID);
    
    /**
     * Add a new feed for user
     * 
     * @param Model_Entity_Feed $feed
     * @return void
     */
    public function addUserFeed(Model_Entity_Feed $feed);
    
    /**
     * Add a new Feed
     * 
     * @param Model_Entity_Feed $feed
     * @return void
     */
    public function addFeed(Model_Entity_Feed $feed);
    
    /**
     * Delete a feed and it's collection of news
     * 
     * @param int $feedID
     * @return void
     */
    public function deleteFeed($feedID);
    
    /**
     * Delete a user feed and it's collection of news
     * 
     * @param Model_Entity_Feed $feed
     * @return void
     */
    public function deleteUserFeed(Model_Entity_Feed $feed);
}
